package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class DBUtil {
	public Connection getConnection(){
		Connection conn=null;		
		try{
			Class.forName("oracle.jdbc.driver.OracleDriver");
			conn=DriverManager.getConnection("jdbc:oracle:thin:@192.168.3.54:1521:orcl","team","team");
			
		}catch(Exception e)
		{
			e.printStackTrace();
		}
		return conn;
	}
	public void closeConnection(Connection conn,Statement stat, ResultSet rs)
	{
		try{
			if(rs!=null)
			{
				rs.close();
			}
			if(stat!=null)
			{
				stat.close();
			}
			if(conn!=null)
			{
			conn.close();
			}
		}catch(Exception e)
		{
			e.printStackTrace();
		}
	}
}
